package com.luculent.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;

import com.luculent.inter.AuthHandlerInterceptor;

@Configuration
public class AuthInterceptorConfig  implements WebMvcConfigurer{
	@Bean
	AuthHandlerInterceptor localInterceptor() {
        return new AuthHandlerInterceptor();
    }
    /**
     * 注册 拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) { 
    	registry.addInterceptor(localInterceptor());
        registry.addInterceptor (new LocaleChangeInterceptor());   
    }

}